package com.dslcode.cloud.common.api.member;

import com.dslcode.cloud.common.model.member.Member;
import com.dslcode.cloud.common.utils.AjaxResponse;
import com.github.pagehelper.PageInfo;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * Created by dongsilin on 2017/10/10.
 */
public interface MemberAPI {

    /**
     * url请求前缀
     */
    String REQUEST_PREFIX = "member";

    @GetMapping(REQUEST_PREFIX)
    AjaxResponse<PageInfo<Member>> list(@RequestParam(name = "pageNum", defaultValue = "1") int pageNum, @RequestParam(name = "pageSize", defaultValue = "10") int pageSize);

    @GetMapping(REQUEST_PREFIX + "/{id}")
    AjaxResponse<Member> detail(@PathVariable(name = "id") Long id);

    /**
     * 增加积分
     * @param id
     * @return
     */
    @PutMapping(REQUEST_PREFIX + "/addPoints/{id}")
    AjaxResponse addPoints(@PathVariable(name = "id") Long id, int points);

}
